import request from '@/utils/request'

/**
  *
  * 获取组织架构数据
  *
  */
export const getDepartmentApi = () => {
  return request({
    url: '/company/department'
  })
}

/**
 * 获取部门负责人列表
 */
export const getManagerListApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 新增组织
 * ***/
export const addDepartmentApi = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 根据部门id获取部门详情
 */
export const getDepartmentDetailApi = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

/** *
 * 更新部门
 * ***/
export const updateDepartmentApi = (data) => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}

/**
 * 删除部门
 *
*/

export const delDepartmentApi = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
